<template>
    <div class="Home">
        <HearderNav></HearderNav>
        <template v-if="AllList.data">
            <Swipe :list="list1"></Swipe>
            <TabalNav :list="list2"></TabalNav>
            <TitelImg :list="list3"></TitelImg>
            <TitelHearder :list="list4"></TitelHearder>

            <TitelImg :list="list5"></TitelImg>
            <ProductList :list="list6"></ProductList>

            <TitelImg :list="list7"></TitelImg>
            <ProductList :list="list8"></ProductList>

            <TitelImg :list="list9"></TitelImg>
            <ProductList :list="list10"></ProductList>

            <TitelImg :list="list11"></TitelImg>
            <ProductList :list="list12"></ProductList>

            <TitelImg :list="list13"></TitelImg>
            <ProductList :list="list14"></ProductList>
            <TitelImg :list="list15"></TitelImg>
            <ProductList :list="list16"></ProductList>
            <TitelImg :list="list17"></TitelImg>
            <ProductList :list="list18"></ProductList>
            <TitelImg :list="list19"></TitelImg>
        </template>
        <Tabbar></Tabbar>
    </div>
</template>

<script>
export default {
    data() {
        return {
            product: [],
            list1: {},
            list2: {},
            list3: {},
            list4: {},
            list5: {},
            list6: {},

            list7: {},
            list8: {},
            list9: {},
            list10: {},
            list11: {},
            list12: {},
            list13: {},
            list14: {},
            list15: {},
            list16: {},
            list17: {},
            list18: {},
            list19: {},
            AllList: {},
        };
    },
    async created() {
        let HomeId = await this.$API.HomeAPI.GetHomeId();
        //    console.log(HomeId);
        this.$store.HomeId = HomeId.data.nav[0];
        this.$store.teamId = HomeId.data.nav[1];
        let data = await this.$API.HomeAPI.GetHomeList({
            pageId: this.$store.HomeId.pageId,
        });
        this.AllList = data;
        // console.log(this.AllList);
        // console.log(data.data.data[5].data.ids);
        this.list1 = data.data.data[0];
        this.list2 = data.data.data[1];
        this.list3 = data.data.data[2].data[0];
        this.list4 = data.data.data[3];

        this.list5 = data.data.data[4].data[0];
        this.list6 = data.data.data[5].data.ids;

        this.list7 = data.data.data[6].data[0];
        this.list8 = data.data.data[7].data.ids;

        this.list9 = data.data.data[8].data[0];
        this.list10 = data.data.data[9].data.ids;

        this.list11 = data.data.data[10].data[0];
        this.list12 = data.data.data[11].data.ids;

        this.list13 = data.data.data[12].data[0];
        this.list14 = data.data.data[13].data.ids;

        this.list15 = data.data.data[14].data[0];
        this.list16 = data.data.data[15].data.ids;
        this.list17 = data.data.data[16].data[0];
        this.list18 = data.data.data[17].data.ids;
        this.list19 = data.data.data[18].data[0];
    },
    mounted() {
        // console.log(this.list6);
    },
};
</script>

<style scoped>
.Home{
    padding-top: 0.5rem;
}
</style>